package cn.wolfcode.p2p.business.mapper;

import cn.wolfcode.p2p.base.query.QueryObject;
import cn.wolfcode.p2p.business.domain.CreditTransfer;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface CreditTransferMapper {

    int insert(CreditTransfer record);

    CreditTransfer selectByPrimaryKey(Long id);

    int updateByPrimaryKey(CreditTransfer record);

    /**
     * 根据bidId 和投资人查询出 准备转让的债权标
     *
     * @param bidIds    :债权的id
     * @param investId :投资人id
     */
    List<CreditTransfer> selectReadyCreditTransForList(@Param("bidIds") Long[] bidIds, @Param("investId") Long investId);

    List selectForList(QueryObject qo);

    CreditTransfer getByBidIdAndTransferFromIdAndState(
            @Param("bidId") Long bidId, @Param("toLoginInfoId") Long toLoginInfoId,
            @Param("bidrequestState") int bidrequestState);

    List<CreditTransfer> selectCanCredittransfer(QueryObject qo);
}